package gridmath;

import preprocessing.WindowingSystem;
import datastructures.UserParameters;

public class ExpectedCasesCalculator extends CaseMatrixBase {
	
	private final int Cases;
//	private final double penetrance;
	
	public ExpectedCasesCalculator(UserParameters userparams, WindowingSystem windowmaker) {
		super(windowmaker, userparams.getMaxorder());
		Cases = userparams.getNumber_of_cases();
//		penetrance = userparams.getPenetrance();
		
		specialTypeOfOperation = MatrixOperations.calculateExpectedCases;	//this is an expected Case calculator
		specialTypeOfOperand = MatrixOperations.calculateFrequency;	//this expects a frequency matrix as an argument
	}
	
	@Override
	public double doOperation (double expectedCarrierFreq) {
		//double effectiveCaseFreq = expectedCarrierFreq*penetrance;
		double effectiveCaseFreq = expectedCarrierFreq;
		return Math.round(Cases * effectiveCaseFreq);
	}
	
}
